package cn.dbqn.controller;

import cn.dbqn.entity.Fodder;
import cn.dbqn.entity.Fodderenter;
import cn.dbqn.service.FodderService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class FodderController {
    @Resource
    FodderService fodderService;
    @RequestMapping("/fodder")
    public String rc(Model model){
        List<Fodder> list=fodderService.findAllxx();
        model.addAttribute("list",list);
        return "lyear_js_colorpicker";
    }

    @RequestMapping("/fodder/kc")
    public String rc1(Model model){
        List<Fodder> list=fodderService.findAllkc();
        model.addAttribute("list",list);
        return "lyear_js_colorpicker";
    }

    @ResponseBody
    @RequestMapping("slxx")
    public  Object  slxx(@RequestParam("fno")Integer fno){
        Fodder slxx=fodderService.slxx(fno);
        return slxx;
    }
}

